import {Suspense} from 'react'
import LoadingStyled from "@/component/loading.module.scss"
import gif from "@/assets/loading.gif"
type LoadingProps = {
	Component: JSX.Element
}



export const Loading = (props:LoadingProps) => {

	const loading = (
		<div className={LoadingStyled.loading}>
			<img src={gif} alt="Loading"/>
		</div>
	)

	return (
		<Suspense fallback={<div>{loading}</div>}>
			{props.Component}
		</Suspense>
	)
}

